package vashion.azeroth.api.controller.item;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import vashion.azeroth.api.controller.base.BaseController;
import vashion.azeroth.core.item.pojo.ItemBrandDO;
import vashion.azeroth.core.item.pojo.ItemForestBrandDO;
import vashion.azeroth.core.manager.item.BaseItemForestBrandManager;
import vashion.azeroth.core.result.ApiResult;

@Controller
@RequestMapping("/api/brand")
public class ItemForestBrandController extends BaseController {

	private final static Logger log = LoggerFactory.getLogger(ItemForestBrandController.class);
	
	@Autowired
	private BaseItemForestBrandManager baseItemForestBrandManager;
	
	/**
	 * 根据多个类目获取完整品牌列表
	 *
	 * @return
	 */
	@RequestMapping("getBrandListByForestIds.htm")
	@ResponseBody
	public ApiResult<List<ItemForestBrandDO>> getBrandListByCategoryIds(@RequestParam(value = "forestIds", required = false) String forestIds) {
		return baseItemForestBrandManager.getBrandListByForestIds(forestIds);
	}
	
	/**
	 * 根据一个类目获取完整品牌列表
	 *
	 * @return
	 */
	@RequestMapping("getBrandListByForestId.htm")
	@ResponseBody
	public ApiResult<List<ItemForestBrandDO>> getBrandListByCategoryId(@ModelAttribute("itemForestBrandDO") ItemForestBrandDO itemForestBrandDO) {
		return baseItemForestBrandManager.getBrandListByForestId(itemForestBrandDO);
	}
}
